package com.zl.learning.object.proxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class WorkProxy implements InvocationHandler {

    Worker2 worker2 = new Worker2();
    Worker1 worker1 = new Worker1();


    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        method.invoke(worker1, args);
        return method.invoke(worker2, args);
    }
}
